<?php
/**
 * Created by PhpStorm.
 * User: 氓羽
 * Date: 2018-3-31
 * Time: 10:58
 */
    class Computer {
        public $cpu = 'Intel';
        public $mainboard = 'hp1024';
        private $hd = 1024;

        public function game($ganmeName=''){
            //echo $this->mainboard;
            if($this->getHdSize() <= 1024){
                echo '硬盘太小，玩不了游戏';
                return false;
            }
            return true;
        }

        public function job($work = 'write'){
            echo ($this->game());
        }

        //获取硬盘大小
        private function getHdSize(){
            return $this -> hd;
        }
    }

    $computer = new Computer();
    //var_dump($computer -> cpu);

    $computer ->job();

